#ifndef AVALON_READER_HPP
#define AVALON_READER_HPP
#include <boost/noncopyable.hpp>
#include "Avalon/IO/IO.hpp"
#include "Avalon/Threading/Async.hpp"

namespace Avalon {
namespace IO {

  /*! \class Reader
   *  \brief Base class for reading data from a resource.
   */
  class Reader : private boost::noncopyable {
    public:

      virtual ~Reader();

      //! Reads from the resource into a Buffer.
      /*!
        \param destination The Buffer to read to.
        \param sizeRead The number of bytes read.
      */
      virtual void Read(Buffer* destination,
        Out<Threading::Async<int> > sizeRead);

      //! Reads from the resource into a specified destination.
      /*!
        \param destination The pointer to read to.
        \param size The maximum size to read.
        \param sizeRead The number of bytes read.
      */
      virtual void Read(void* destination, int size,
        Out<Threading::Async<int> > sizeRead) = 0;

      //! Reads a from the resource into a Buffer up to a maximum size.
      /*!
        \param destination The Buffer to read to.
        \param size The maximum number of bytes to read.
        \param sizeRead The number of bytes read.
      */
      virtual void Read(Buffer* destination, int size,
        Out<Threading::Async<int> > sizeRead) = 0;
  };
}
}

#endif // AVALON_READER_HPP
